<template>
<!--用户-->
  <div class="user">
<!--    左侧菜单栏-->
    <div class="menu">
      <el-menu
          :default-active="route.path"
          class="el-menu-vertical-demo"
      >
        <el-menu-item index="/user/authentication" @click="gouser('/user/authentication')">
          <el-icon><User /></el-icon>
          <span>实名认证</span>
        </el-menu-item>
        <el-menu-item index="/user/orders" @click="gouser('/user/orders')">
          <el-icon><Edit /></el-icon>
          <span>挂号订单</span>
        </el-menu-item>
        <el-menu-item index="/user/manage" @click="gouser('/user/manage')">
          <el-icon><Operation /></el-icon>
          <span>就诊人管理</span>
        </el-menu-item>
        <el-menu-item index="/user/modify" @click="gouser('/user/modify')">
          <el-icon><Setting /></el-icon>
          <span>修改账号信息</span>
        </el-menu-item>
        <el-menu-item index="/user/feedback" @click="gouser('/user/feedback')">
          <el-icon><Message /></el-icon>
          <span>意见反馈</span>
        </el-menu-item>
      </el-menu>
    </div>
<!--    内容-->
    <div class="content">
         <router-view></router-view>
    </div>
  </div>
</template>

<script setup lang="ts">
import {Message,Setting,Operation,Edit,User} from '@element-plus/icons-vue'
import {useRouter,useRoute} from "vue-router";
const router=useRouter()
const route=useRoute()
// 切换路由
const gouser=(index:string)=>{
  router.push({
    path:index
  })
}
</script>

<style scoped lang="scss">
.user{
  display: flex;
  padding-top: 40px;
  .menu{
    flex:2;
    position: fixed;
  }
  .content{
    flex: 8;
    margin-left: 200px;
  }
}
</style>